<?php switch($content_type){
case 'm_fp': ?>
<dl>
    <dd class="cp-header">
        <?php echo $text_latest_posts_approval; ?>
    </dd>
    <dd class="cp-content">
    <?php if(!$approval_posts){ ?>
        <dl>
            <dd><?php echo $text_no_posts_approval; ?></dd>
        </dl>
    <?php }else{ ?>
        <form id="post-approval-form" name="post-approval-form" action="" method="post">
        <dl>
            <dd><?php echo $text_total_posts_approval; ?></dd>
        </dl>
        <?php foreach($approval_posts as $approval_post){ ?>
        <dl class="cp-list">
            <dd class="cp-list-first cp-list-first-unindent">
                <a href="<?php echo $approval_post['post_moderating_link']; ?>"><strong><?php echo $approval_post['post_subject']; ?></strong></a><br />
                <?php echo $approval_post['posted_by']; ?>
            </dd>
            <dd class="cp-list-second cp-list-second-expand">
                <?php echo $text_topic; ?>
                <a href="<?php echo $approval_post['topic_link']; ?>"><?php echo $approval_post['topic_title']; ?></a>&ndash;
                <a style="color:#BC2A4D;" href="<?php echo $approval_post['topic_moderating_link']; ?>"><?php echo $text_moderate; ?></a>
                <br />
                <?php echo $text_forum; ?>
                <a href="<?php echo $approval_post['fourm_link']; ?>"><?php echo $approval_post['forum_name']; ?></a>
                &ndash;
                <a style="color:#BC2A4D;" href="<?php echo $approval_post['forum_moderating_link']; ?>"><?php echo $text_moderate; ?></a>
            </dd>
            <dd class="cp-list-third">
                <input type="checkbox" name="marked_p_id[]" value="<?php echo $approval_post['post_topic_forum_first_id'] ; ?>" />
            </dd>
        </dl>
        <?php } ?>
        <dl class="cp-list-bottom">
            <dd>
                <?php echo $text_notify_poster; ?>&nbsp;<input type="checkbox" name="notify-poster" checked="checked" />&nbsp;&nbsp;
                <input class="input-buttons" type="submit" name="approve-posts" value="<?php echo $button_approve; ?>" onclick="{if(confirm('<?php echo $text_confirm_approval; ?>')){this.document.post-approval-form.submit();return true;}return false;}" />
                &nbsp;&nbsp;
                <input class="input-buttons" type="submit" name="disapprove-posts" value="<?php echo $button_disapprove; ?>" onclick="{if(confirm('<?php echo $text_confirm_disapproval; ?>')){this.document.post-approval-form.submit();return true;}return false;}" />
            </dd>
            <?php if(count($approval_posts)>1){ ?>
            <dd style="float:left;">
                &bull; <a href="#" onclick="marklist('post-approval-form', 'marked_p', true); return false;"><?php echo $text_mark_all; ?></a>
                &bull; <a href="#" onclick="marklist('post-approval-form', 'marked_p', false); return false;"><?php echo $text_unmark_all; ?></a>
            </dd>
            <?php } ?>
        </dl>
        </form>
    <?php } ?>
    </dd>
</dl>
<dl>
    <dd class="cp-header">
        <?php echo $text_latest_reports; ?>
    </dd>
    <dd class="cp-content">
        <?php if(!$reports){ ?>
        <dl>
            <dd><?php echo $text_no_reports; ?></dd>
        </dl>
        <?php }else{ ?>
            <dl>
                <dd><?php echo $text_total_reports; ?></dd>
            </dl>
            <?php foreach($reports as $report){ ?>
            <dl class="cp-list">
                <dd class="cp-list-first cp-list-first-unindent">
                    <a href="<?php echo $report['report_moderating_link']; ?>"><strong><?php echo $report['post_subject']; ?></strong></a>
                    <br />
                    <?php echo $report['posted_by']; ?>
                </dd>
                <dd class="cp-list-third">
                    <?php echo $report['reported_by']; ?>
                    <br />
                    <?php echo $text_forum; ?>
                    <a href="<?php echo $report['fourm_link']; ?>"><?php echo $report['forum_name']; ?></a>
                </dd>
            </dl>
            <?php } ?>
        <?php } ?>
    </dd>
</dl>
<dl>
    <dd class="cp-header">
        <?php echo $text_latest_pm_reports; ?>
    </dd>
    <dd class="cp-content">
        <?php if(!$reports){ ?>
        <dl>
            <dd><?php echo $text_no_pm_reports; ?></dd>
        </dl>
        <?php }else{ ?>
        <dl>
            <dd><?php echo $text_total_pm_reports; ?></dd>
        </dl>
        <?php foreach($pm_reports as $pm_report){ ?>
            <dl class="cp-list">
                <dd class="cp-list-first cp-list-first-unindent">
                    <a href="<?php echo $pm_report['pm_report_moderating_link']; ?>"><strong><?php echo $pm_report['message_subject']; ?></strong></a><br />
                    <?php echo $pm_report['sent_by']; ?><br />
                    <?php echo $text_to; ?>
                    <?php $i=0; ?>
                    <?php foreach($pm_report['receiver_names'] as $receiver_name){ ?>
                    <a href="<?php echo $pm_report['receiver_profile_urls'][$i]; ?>"><?php echo $receiver_name; ?></a>
                    <?php $i++; ?>
                    <?php } ?>
                </dd>
                <dd class="cp-list-third">
                    <?php echo $pm_report['reported_by']; ?>
                </dd>
            </dl>
            <?php } ?>
        <?php } ?>
    </dd>
</dl>
<?php break; ?>
<?php case 'm_vf': ?>
<form id="view-forum-form" action="" method="post">
<dl>
    <dd class="cp-header">
        <?php if($forum_selected){ ?>
        <a style="font-size:16px;" href="<?php echo $forum['forum_link']; ?>"><?php echo $forum['forum_name']; ?></a>
        <?php }else{ ?>
        <?php echo $text_select_forum; ?>
        <?php } ?>
        <select id="fid" name="fid">
            <?php if($has_global_privilege){ ?>
            <option value=""><?php echo $text_select_forum; ?></option>
            <?php } ?>
            <?php foreach($forums as $forum){ ?>
            <option value="<?php echo $forum['forum_id']; ?>" <?php echo $forum_option_id==$forum['forum_id']?'selected="selected"':'' ?>><?php echo $forum['forum_name']; ?></option>
            <?php foreach($sub_forums[$forum['forum_id']] as $sub_forum){ ?>
            <option value="<?php echo $sub_forum['forum_id']; ?>" <?php echo $forum_option_id==$sub_forum['forum_id']?'selected="selected"':'' ?>>&nbsp;&nbsp;<?php echo $sub_forum['forum_name']; ?></option>
            <?php } ?>
            <?php } ?>
        </select>
    </dd>
    <dd class="cp-content">
        <?php if(!$forum_selected || !$topics){ ?>
        <dl>
            <dd><strong><?php echo $text_no_topics; ?></strong></dd>
        </dl>
        <?php }else{ ?>
        <dl class="cp-list-heading">
            <dd class="cp-list-heading-first"><?php echo $text_heading_topic; ?></dd>
            <dd class="cp-list-heading-second"><?php echo $text_heading_last_post; ?></dd>
            <dd class="cp-list-heading-third"><?php echo $text_heading_mark; ?></dd>
        </dl>
        <?php $t=0; ?>
        <?php foreach($topics as $topic ){ ?>
        <dl class="cp-list <?php echo $topic['is_reported'] ? 'topic_reported' : ''; ?>">
            <dd class="cp-list-first <?php echo $topicStatus[$t]; ?>" title="<?php echo $text_topic_status[$t]; ?>">
                <span>
                    <a href="<?php echo $topic['topic_moderate_link']; ?>"><strong><?php echo $topic['topic_title']; ?></strong></a>
                    <?php echo $topic['is_reported'] ? '&nbsp;<a title="' . $text_topic_reported . '" href="' . $reported_topic_link . '"><img style="vertical-align:middle;" src="catalog/view/theme/default/image/post/icon_topic_reported.gif" /></a>' : ''; ?>
                    <?php echo $topic['awaiting_approval'] ? '&nbsp;<a title="' . $text_topic_awaiting_approval . '" href="' . $approve_topic_link . '"><img style="vertical-align:middle;" src="catalog/view/theme/default/image/post/icon_topic_unapproved.gif" /></a>' : ''; ?>
                </span><br />
                <span><?php echo $text_by; ?>&nbsp;<a href="<?php echo $topic['topic_poster_link']; ?>"><?php echo $topic['topic_first_poster_name']; ?></a> &raquo; <?php echo $topic['topic_time']; ?></span>
            </dd>
            <dd class="cp-list-second">
                <span><?php echo $text_by; ?>&nbsp;<a href="<?php echo $topic['topic_last_poster_link']; ?>"><?php echo $topic['topic_last_poster_name']; ?></a></span><br />
                <?php echo $topic['topic_last_post_time']; ?>
            </dd>
            <dd class="cp-list-third">
                <input type="checkbox" name="marked_t_id[]" value="<?php echo $topic['topic_id'] ; ?>" />
            </dd>
        </dl>
        <?php $t++; ?>
        <?php } ?>
        <?php if($topic_total>0){ ?>
        <dl class="cp-list-bottom">
            <dd>
                <select id="moderate-action" name="moderate-action">
                    <option value="-1"><?php echo $text_select_action; ?></option>
                    <?php if($can_delete_topic){ ?>
                    <option value="d"><?php echo $text_delete; ?></option>
                    <?php } ?>
                    <?php if($can_move_topic){ ?>
                    <option value="m"><?php echo $text_move; ?></option>
                    <?php } ?>
                    <?php if($can_lock_topic){ ?>
                    <option value="l"><?php echo $text_lock; ?></option>
                    <option value="u"><?php echo $text_unlock; ?></option>
                    <?php } ?>
                    <?php if($can_feature_topic){ ?>
                    <option value="f"><?php echo $text_set_as_featured; ?></option>
                    <?php } ?>
                    <?php if($can_stick_topic || $can_announce_topic || $can_globally_announce_topic){ ?>
                    <option value="sd"><?php echo $text_change_to_standard; ?></option>
                    <?php } ?>
                    <?php if($can_stick_topic){ ?>
                    <option value="st"><?php echo $text_change_to_sticky; ?></option>
                    <?php } ?>
                    <?php if($can_announce_topic){ ?>
                    <option value="a"><?php echo $text_change_to_announcement; ?></option>
                    <?php } ?>
                    <?php if($can_globally_announce_topic){ ?>
                    <option value="g"><?php echo $text_change_to_global; ?></option>
                    <?php } ?>
                </select>&nbsp;&nbsp;&nbsp;&nbsp;
                <input class="input-buttons" type="submit" name="submit" value="<?php echo $button_submit; ?>" onclick="{if(confirm('<?php echo $text_confirm_submit; ?>')){this.document.view-forum-form.submit();return true;}return false;}" /><br /><br />
                <span id="sticky-time-input" style="display:none;"><?php echo $text_stick_topic; ?>&nbsp;&nbsp;<input type="text" name="sticky-time" value="" />&nbsp;&nbsp;<?php echo $days; ?></span>
                <span id="move-to-fid" style="display:none;">
                <?php echo $text_select_forum; ?>&nbsp;&nbsp;
                <select name="dfid">
                    <?php foreach($des_forums as $des_forum){ ?>
                    <option value="<?php echo $des_forum['forum_id']; ?>"><?php echo $des_forum['forum_name']; ?></option>
                    <?php foreach($des_sub_forums[$des_forum['forum_id']] as $des_sub_forum){ ?>
                        <option value="<?php echo $des_sub_forum['forum_id']; ?>" >&nbsp;&nbsp;<?php echo $des_sub_forum['forum_name']; ?></option>
                        <?php } ?>
                    <?php } ?>
                </select>
                </span>
            </dd>
            <?php if($topic_total>1){ ?>
            <dd style="float:left;">
                &bull; <a href="#" onclick="marklist('view-forum-form', 'marked_t', true); marklist('view-forum-form', 'marked_t', true); return false;"><?php echo $text_mark_all; ?></a>
                &bull; <a href="#" onclick="marklist('view-forum-form', 'marked_t', false); marklist('view-forum-form', 'marked_t', false); return false;"><?php echo $text_unmark_all; ?></a>
            </dd>
            <?php } ?>
        </dl>
        <div class="forum-pagination"><?php echo $pagination; ?></div>
        <?php } ?>
        <?php } ?>
    </dd>
</dl>
</form>
<script type="text/javascript"><!--
$(document).ready(
    function(){
        $(".cp-list").filter(":even").mouseover(function() {
            $(this).css("background-color", "#FFFFDB");
        }).mouseout(function(){
                $(this).css("background-color", "");
            });

        $(".cp-list").filter(":odd").mouseover(function() {
            $(this).css("background-color", "#FFFFDB");
        }).mouseout(function(){
                $(this).css("background-color", "");
            });
    });

$('#fid').bind('change', function() {
    url = 'index.php?route=community/mcp&mode=m&action=vf';

    var keyword = $('.cp-header select[name=\'fid\']').attr('value');

    if(keyword != ''){
        url += '&fid=' + encodeURIComponent(keyword);
    }

    location = url;
});

$('.cp-list-bottom select[name=\'moderate-action\']').live('change', function() {
    if (this.value == 'm') {
        $('#sticky-time-input').hide();
        $('#move-to-fid').show();
    } else if(this.value == 'st' || this.value == 'a' || this.value == 'g') {
        $('#sticky-time-input').show();
        $('#move-to-fid').hide();
    }else {
        $('#sticky-time-input').hide();
        $('#move-to-fid').hide();
    }
});
//--></script>
<?php break; ?>
<?php case 'm_vt': ?>
<form id="view-topic-form" action="" method="post">
<dl>
    <dd class="cp-header">
        <a style="font-size:16px;" href="<?php echo $topic_link; ?>"><?php echo $topic_title; ?></a>
        <input type="hidden" name="first_post_id" value="<?php echo $topic_first_post_id; ?>" />
        <input type="hidden" name="last_post_id" value="<?php echo $topic_last_post_id; ?>" />
    </dd>
    <dd class="cp-content">
        <?php foreach($posts as $post ){ ?>
        <dl class="cp-view-topic <?php echo $post['odd_even_post']; ?> <?php echo $post['is_reported'] ? 'reported-post' : ''; ?>">
            <dd class="cp-view-topic-header">
                <span>
                    <a href="<?php echo $post['post_link']; ?>"><strong><?php echo $post['post_subject']; ?></strong></a>
                    <input type="checkbox" name="marked_p_id[]" value="<?php echo $post['post_id'] ; ?>" />
                </span><br />
                <span class="gray-font"><?php echo $text_by; ?>&nbsp;<a href="<?php echo $post['poster_link']; ?>"><?php echo $post['username']; ?></a> &raquo; <?php echo $post['post_time']; ?></span>
            </dd>
            <dd class="cp-view-topic-body">
                <?php if($post['is_reported']){ ?>
                <div class="reported-post-bar">
                    <a href="<?php echo $post['view_report_link']; ?>"> <strong><?php echo $text_view_report; ?></strong></a>
                </div>
                <?php } ?>
                <?php echo $post['post_text']; ?>
            </dd>
        </dl>
        <?php } ?>
        <?php if($post_total>0){ ?>
        <dl class="cp-list-bottom">
            <dd>
                <select name="moderate-action">
                    <option value="-1"><?php echo $text_select_action; ?></option>
                    <?php if($can_delete_post){ ?>
                    <option value="d"><?php echo $text_delete; ?></option>
                    <?php } ?>
                    <?php if($can_lock_post){ ?>
                    <option value="l"><?php echo $text_lock_post; ?></option>
                    <option value="u"><?php echo $text_unlock_post; ?></option>
                    <?php } ?>
                </select>&nbsp;&nbsp;&nbsp;&nbsp;
                <input class="input-buttons" type="submit" name="submit" value="<?php echo $button_submit; ?>" onclick="{if(confirm('<?php echo $text_confirm_submit; ?>')){this.document.view-forum-form.submit();return true;}return false;}" /><br /><br />
                <?php if($post_total>1){ ?>
                &bull; <a href="#" onclick="marklist('view-topic-form', 'marked_p', true); marklist('view-topic-form', 'marked_p', true); return false;"><?php echo $text_mark_all; ?></a>
                &bull; <a href="#" onclick="marklist('view-topic-form', 'marked_p', false); marklist('view-topic-form', 'marked_p', false); return false;"><?php echo $text_unmark_all; ?></a>
                <?php } ?>
            </dd>
        </dl>
        <div class="forum-pagination"><?php echo $pagination; ?></div>
        <?php } ?>
    </dd>
</dl>
</form>
<?php break; ?>
<?php } ?>